//
//  HBShakeResultFriendHeaderCell.m
//  HuoBao
//
//  Created by chaiyanan on 15/12/10.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "HBShakeResultFriendHeaderCell.h"

@implementation HBShakeResultFriendHeaderCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self createCustomView];
    }
    return self;
}

- (void)createCustomView
{
    UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH-30, Height_HBShakeResultFriendHeaderCell)];
    bgView.backgroundColor = [LCCommon getColor:@"37383d"];
    [self.contentView addSubview:bgView];
    
    UILabel *titleLable = [self createLableWithTextColor:[LCCommon getColor:@"b1b1b1"] font:[UIFont systemFontOfSize:17.0f] text:@"好友加息排行" textAlignment:NSTextAlignmentCenter frame:CGRectMake(15, 21, SCREEN_WIDTH-30, 17) superView:self.contentView];
    [self createLableWithTextColor:[LCCommon getColor:@"b1b1b1"] font:[UIFont systemFontOfSize:14.0f] text:@"姓名" textAlignment:NSTextAlignmentCenter frame:CGRectMake(15, titleLable.y+titleLable.height+23, bgView.width/2, 14) superView:self.contentView];
    [self createLableWithTextColor:[LCCommon getColor:@"b1b1b1"] font:[UIFont systemFontOfSize:14.0f] text:@"今日加息" textAlignment:NSTextAlignmentCenter frame:CGRectMake(15+bgView.width/2, titleLable.y+titleLable.height+23, bgView.width/2, 14) superView:self.contentView];
    
}

- (UILabel *)createLableWithTextColor:(UIColor *)color font:(UIFont *)font text:(NSString *)text textAlignment:(NSTextAlignment)textAlignment frame:(CGRect)frame superView:(UIView *)superView
{
    UILabel *lable = [[UILabel alloc]initWithFrame:frame];
    lable.textColor = color;
    lable.font = font;
    lable.text = text;
    lable.textAlignment = textAlignment;
    [superView addSubview:lable];
    return lable;
}

@end
